Conversation
commands::ontology loads ~/.config/forge/config.yaml (typed, FORGE_* env precedence, project.yaml fallback with deprecation warning). forge config prints the resolved ontology. forge exec runs skill-bundled scripts by extension (.py via uv run, .sh via bash, .ts via deno), injecting FORGE_*/ INPUT_* env and wrapping stdout/stderr with optional outputSchema validation. Unknown 'forge <verb>' dispatches to an external forge-<verb> in the module commands/ dir, config extension dirs, then PATH — so new verbs are scripts, not Rust. ADRs CLI-0013/0014/0015.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Approach
The minimal-kernel phase: push capability out of Rust and into scripts so the CLI stops growing.
commands::ontology— typed loader for~/.config/forge/config.yamlwithFORGE_*env precedence andproject.yamlfallback (deprecation warning).forge config --jsonprints the resolved ontology with per-key source tracking.forge exec <skill>— runs a skill's bundled script by extension (.py→uv runPEP 723,.sh→bash,.ts→deno,.js→node), injectingFORGE_*/INPUT_*env, piping the--jsonobject on stdin, and wrapping results as{ok, exit_code, stdout, structured}with optionaloutputSchemavalidation.--dry-runshows resolved argv + env.forge <verb>execs an externalforge-<verb>from the modulecommands/dir, config extension dirs, then PATH. Built-ins match first (can't be shadowed). New verbs are scripts, not Rust.ADRs: CLI-0013 (unified config), CLI-0014 (exec contract), CLI-0015 (git-style dispatch).
Adversarial review (self, cross-harness pass)
Reviewed the two arbitrary-code-execution surfaces. Findings fixed in this PR:
forge exec --script/ skillscript:(skill_dir.joinescaping via../absolute) — now canonicalized and asserted within the skill dir.INPUT_*injection is safe by construction (INPUT_prefix + non-alphanumeric sanitization; can't overridePATH/LD_PRELOAD).Known/accepted (documented): repo-local
commands/forge-*execute without a trust gate when youcdinto a repo, like a Makefile; matches the extend-freely design and built-ins can't be shadowed. Candidate for a futureforge trustgate.Test plan
forge config --json;forge helloexternal dispatch; unknown-verb clean error;forge exec.sh round-trip with INPUT_* + structured output; --dry-run🤖 Generated with Claude Code